
'------------------------------------------------------
' Hands-On 1-1
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-2
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-3
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-4
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-5
' Recorded macro code. 
' Please follow the instructions in the book.
'------------------------------------------------------

Sub WhatsInACell()
'
' WhatsInACell Macro
' Indicates the contents of the underlying cells: text, numbers, and
' formulas.
'
'
  Selection.SpecialCells(xlCellTypeConstants, 2).Select
  Selection.Style = "Accent4"
  Range("C2").Select
  Selection.SpecialCells(xlCellTypeConstants, 1).Select
  Selection.Style = "Neutral"
  Range("C3").Select
  Selection.SpecialCells(xlCellTypeFormulas, 23).Select
  Selection.Style = "Calculation"
  Range("A1:A4").Select
  Selection.EntireRow.Insert
  Range("A1").Select
  Selection.Style = "Accent4"
  Range("B1").Select
  ActiveCell.FormulaR1C1 = "Text"
  Range("A2").Select
  Selection.Style = "Neutral"
  Range("B2").Select
  ActiveCell.FormulaR1C1 = "Numbers"
  Range("A3").Select
  Selection.Style = "Calculation"
  Range("B3").Select
  ActiveCell.FormulaR1C1 = "Formulas"
  Range("B1:B3").Select
  With Selection.Font
   .Name = "Arial Narrow"
   .FontStyle = "Bold Italic"
   .Size = 10
   .Strikethrough = False
   .Superscript = False
   .Subscript = False
   .OutlineFont = False
   .Shadow = False
   .Underline = xlUnderlineStyleNone
   .ThemeColor = xlThemeColorLight1
   .TintAndShade = 0
   .ThemeFont = xlThemeFontNone
  End With
End Sub


'------------------------------------------------------
' Hands-On 1-6
' Recorded macro code.
' Please follow the instructions in the book.
'------------------------------------------------------

Sub RemoveFormats()
'
' RemoveFormats Macro
'

'
    Cells.Select
    Range("F12").Activate
    ActiveWindow.WindowState = xlNormal
    ActiveWindow.WindowState = xlNormal
    Selection.ClearFormats
    ActiveWindow.WindowState = xlNormal
    ActiveWindow.WindowState = xlNormal
    ActiveWindow.ScrollRow = 7
    ActiveWindow.ScrollRow = 6
    ActiveWindow.ScrollRow = 5
    ActiveWindow.ScrollRow = 4
    ActiveWindow.ScrollRow = 3
    ActiveWindow.ScrollRow = 2
    ActiveWindow.ScrollRow = 1
    Range("A1:A4").Select
    Selection.EntireRow.Delete
    Range("A1").Select
End Sub


'------------------------------------------------------
' Hands-On 1-7
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-8
' Macro recorded in this chapter
'------------------------------------------------------

Sub WhatsInACell()
'
' WhatsInACell Macro
' Indicates the contents of the underlying cells: text, numbers, and
' formulas.
'
'
    Selection.SpecialCells(xlCellTypeConstants, 2).Select
    Selection.Style = "Accent4"
    Range("C2").Select
    Selection.SpecialCells(xlCellTypeConstants, 1).Select
    Selection.Style = "Neutral"
    Range("C3").Select
    Selection.SpecialCells(xlCellTypeFormulas, 23).Select
    Selection.Style = "Calculation"
    Range("A1:A4").Select
    Selection.EntireRow.Insert
    Range("A1").Select
    Selection.Style = "Accent4"
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "Text"
    Range("A2").Select
    Selection.Style = "Neutral"
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "Numbers"
    Range("A3").Select
    Selection.Style = "Calculation"
    Range("B3").Select
    ActiveCell.FormulaR1C1 = "Formulas"
    Range("B1:B3").Select
    With Selection.Font
        .Name = "Arial Narrow"
        .FontStyle = "Bold Italic"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ThemeColor = xlThemeColorLight1
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
End Sub


'------------------------------------------------------
' Hands-On 1-9
' Please follow the instructions in the book for
' adding comments into the recorded macro.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-10
' No code for this Hands-On. 
' Please follow the instructions in the book for cleaning
' up the recorded macro code.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-11
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-12
' Additional recorded macro
'------------------------------------------------------

Sub Macro3()
'
' Macro3 Macro
'
'
    Range("A1:B3").Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlMedium
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlMedium
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlMedium
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlMedium
    End With
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    Range("A1").Select
End Sub


'------------------------------------------------------
' Hands-On 1-13
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-14
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-15
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------

'------------------------------------------------------
' Hands-On 1-16
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-17
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-18
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-19
' No code for this Hands-On. 
' Please follow the instructions in the book.
'------------------------------------------------------


'------------------------------------------------------
' Hands-On 1-20
' Recorded macro code/after modification.
' Please follow the instructions in the book.
'------------------------------------------------------


Sub FormulasOnOff()
'
' FormulasOnOff Macro
'
' Keyboard Shortcut: Ctrl+Shift+F
'
  ActiveWindow.DisplayFormulas = Not ActiveWindow.DisplayFormulas
End Sub













